package com.tangbue.myrule;


import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//此配置类单独存放，目的设置Ribbon的负载算法
@Configuration
public class MySelfRule {

    @Bean
    public IRule myRule() {
        //自定义为随机,如果不设置，则默认为轮询
        return new RandomRule();
    }
}